import request from '../../utils/request'
import { generateRandomCodeForValidateCode } from '../../utils/randomCodeGenerator'
const api_name = "user"

/**用户登录 */
export function login(userInfo) {
    return request({
        url: `/${api_name}/login`,
        method: 'post',
        data: userInfo,
        headers: {
            action: "usercheckpass"
        }
    })
}

/** 用户登出*/
export function logout() {
    return request({
        url: `/${api_name}/logout`,
        method: 'post',
        headers: {
            action: "usercheckpass"
        }
    })
}
/** 前台用户注册*/
export function regist(registModel) {
    return request({
        url: `${api_name}/regist`,
        method: 'post',
        data: registModel,
        headers: {
            action: "usercheckpass"
        }
    })
}
/**发送验证码 */
export function sendValidateCode(mode,receiver) {
    return request({
        url: `/${api_name}/sendcode/${mode}/${receiver}`,
        method: 'get',
        headers: {
            action: "usercheckpass"
        }
    })
}

/**修改密码*/
export function updatePassword(updatepassVo) {
    return request({
        url: `/${api_name}/updatepass`,
        method: 'put',
        data: updatepassVo
    })
}


